package com.des1gn.processor;

import com.des1gn.common.bean.RetryErrorMqMessageDto;
import org.springframework.context.ApplicationContext;

/**
 * @ClassName MqPostProcessor
 * @Description 重试故障存档触发器
 * @Author Des1gn
 * @Version 1.0
 **/
public class MqPostProcessor {

    public static void doProcess(RetryErrorMqMessageDto retryErrorMqMessageDto){
        ApplicationContext applicationContext = ApplicationContextHelper.getApplicationContext();
        for (String beanName : applicationContext.getBeanNamesForType(RetryFaultHandler.class)) {
            RetryFaultHandler bean = (RetryFaultHandler)applicationContext.getBean(beanName);
            bean.retryFaultProcess(retryErrorMqMessageDto);
        }
    }

}
